class Bank:
    def __init__(self, preacher=0, savage=0):
        self.preacher = preacher
        self.savage = savage

    def move(self, opposite_bank, boat=2, delta_preacher=0, delta_savage=0):
        # 超载
        # 变化人数<0
        # 变化人数不在已有人数范围内
        # 船上野人数量大于传教士
        if delta_savage + delta_preacher > boat \
                or delta_savage < 0 or delta_preacher < 0 \
                or delta_preacher > self.preacher or delta_savage > self.savage or (
                delta_preacher != 0 and delta_preacher < delta_savage):
            return False

        # 变化后本岸野人人数大于传教士
        if self.preacher - delta_preacher < self.savage - delta_savage and self.preacher - delta_preacher != 0:
            return False

        # 变化后对岸野人人数大于传教士
        if opposite_bank.preacher + delta_preacher < opposite_bank.savage + delta_savage \
                and opposite_bank.preacher + delta_preacher != 0:
            return False

        self.savage -= delta_savage
        self.preacher -= delta_preacher
        opposite_bank.savage += delta_savage
        opposite_bank.preacher += delta_preacher

        return True

    def is_empty(self):
        return self.preacher == 0 and self.savage == 0

    def is_full(self, number):
        return self.preacher == number and self.savage == number
